home *** CD-ROM | disk | FTP | other *** search
- Path: inforamp.net!ts13-11
- From: rmorin@inforamp.net (Randy Charles Morin)
- Newsgroups: comp.lang.c++
- Subject: Re: Coding Standards
- Date: Wed, 20 Mar 96 04:24:16 GMT
- Organization: MiddleWorld SoftWare
- Message-ID: <4io1a4$n9v@sam.inforamp.net>
- References: <4hj8ek$elu@sam.inforamp.net> <4hktar$5o2@galaxy.ucr.edu>
- <4hmqol$97j@abacus.abasoft.co.uk> <4hsg8r$pmm@sam.inforamp.net>
- <4i9o6j$p4l@daisy.pgh.wec.com> <4idskb$pc1@sam.inforamp.net> <CBARBER.96Mar18104644@figaro.bbn.com>
- NNTP-Posting-Host: ts34-09.tor.inforamp.net
- X-Newsreader: News Xpress Version 1.0 Beta #4
-
- In article <CBARBER.96Mar18104644@figaro.bbn.com>,
- cbarber@bbn.com (Christopher Barber) wrote:
- > Randy> ------- -source files should have the extension .cc (not .cpp or
- > Randy> .c). I don't think I have to say anything here.
- > Randy> -header files should have the extension .hh (not .hpp or
- > Randy> .h). I don't think I have to say anything here.
- >
- >Sure you do. Do you really consider this an argument?
-
- ??? Let's be reasonable.
-
- >There is no such thing as "normal industry practices". Although a bit
- >extreme, this convention does have some advantages:
-
- There is no such think as "normal industry practices? Why? Almost everybody
- uses .h for headers and .cpp for source files. This is a normal industry
- practice. Is it not?
-
- > Randy> -a class which can be instantiated with a "new" must have a
- > Randy> copy constructor, a destructor and an assignment operator
- > Randy> definition. Most compilers (if not all) supply default copy
- > Randy> construtors. Unless you think your class may have copy behavior
- > Randy> problems, then writing copy constructors is redundant. When you
- > Randy> have 100+ classes to write and where the average copy
- > Randy> constructor has 50 lines, you would need 100 hours to write the
- > Randy> additional robustness (or cumbersomeness).
- >Aren't you getting a bit extreme here? I have written hundreds of
- >copy constructors and only a handful came even close to 50 lines long.
- >Yes, the compiler will generate a copy constructor for you, but it
- >has the wrong behavior in many cases.
-
- Where am I being a little extreme? We do have 100+ classes, I have already
- identified about 100. I calculated the average amount of lines per copy
- constructor in another project and it came out just below 50. The average
- programmer on that project wrote less than 50 lines an hour. That's 100
- hours. It's math.
-
- > Randy> -never use #define instead or const. This is a good
- > Randy> debate, but I still maintain that if your memory model and
- > Randy> compiler make #define data text and const code text, then you
- > Randy> cannot consider this a straight forward trade-off.
- >Didn't you say this was a Unix project? There is no such thing
- >as a "memory model" in Unix.
-
- First of all, you end the argument by accepting that the code will only run in
- one environment. These coding standards are for Unix, DOS, Windows
- 95&NT, OS/2, etc. Coding standards that apply in more than one environment,
- should also work in more than one environment. Second of all, this project
- was originally specified in OS/2. They respecified it as Windows 95 and they
- want to port it to Mac and others.
-
- >Anyway, enough of this. Some of the rules are a bit extreme or silly.
- >But many are quite reasonable and you don't seem to be able to distinguish
- >between the two.
-
- Again the hollier than thou attitude I talked about. You can't just respond
- in the negative, you have to try to insult me. Just shows your maturity.
-
- Agrivar
-